const fs = require('fs');
// 文件读取演示
const p = new Promise(function (resolve, reject) {
    fs.readFile('../mqtt/indoor/mqtt.js', (err, data) => {
        if (err) {
            reject(err);
        } else {
            resolve(data.toString());
        }
    });
});

p.then(function (value) {
    console.log(value);
}, function (reason) {
    console.error(reason);
})